]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
osdWindow: Allow label and level to be null
authorStuart Hayhurst <stuart.a.hayhurst@gmail.com>
Sun, 27 Aug 2023 18:25:42 +0000 (19:25 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 28 Aug 2023 17:16:11 +0000 (17:16 +0000)
Allow passing 'null' to setLevel and setLabel, so 'null' and 'undefined'
behave the same way.

Fixes a regression introduced by a42f7c23, which caused parts of old
notifications to persist into new notifications, or elements being
incorrectly made visible

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2917>

js/ui/osdWindow.js

index dcefd44c90dbcbc0f7a4cc8c823816ced25ad8c1..9d32e40cb14c63020dc891ad8975fed4f4742748 100644 (file)
@@ -65,15 +65,15 @@ class OsdWindow extends Clutter.Actor {
     }
 
     setLabel(label) {
-        this._label.visible = label !== undefined;
-        if (label)
+        this._label.visible = label != null;
+        if (this._label.visible)
             this._label.text = label;
         this._updateBoxVisibility();
     }
 
     setLevel(value) {
-        this._level.visible = value !== undefined;
-        if (value !== undefined) {
+        this._level.visible = value != null;
+        if (this._level.visible) {
             if (this.visible) {
                 this._level.ease_property('value', value, {
                     mode: Clutter.AnimationMode.EASE_OUT_QUAD,